#ifndef GITHUBDISCUSSIONS_H
#define GITHUBDISCUSSIONS_H

#include <wiki/wiki.h>

class GitHubDiscussions : public Wiki
{
public:
    GitHubDiscussions();

    // Wiki interface
public:

    WIKI_AUTOLOAD
    WIKI_USE_URL
    WIKI_FORWARED_CONTENT
};

#define GITHUB_DISCUSSION_INNER(x, y)                     \
public:                                             \
    virtual QString name() override { return x; }   \
    virtual QString prefix() override { return "https://github.com/" y "/discussions?discussions_q=is%3Aopen+"; } \
    virtual QString content(const QString &text) override { return text.isEmpty() ? "https://github.com/" y "/discussions" : prefix() + text; }

#define GITHUB_DISCUSSION(x,y,z)                           \
class x : public GitHubDiscussions                          \
{                                                           \
public:                                                     \
    x() {}                                                  \
    GITHUB_DISCUSSION_INNER(y, z)                          \
};                                                          \

#endif // GITHUBDISCUSSIONS_H
